-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS opacity
based on prefers-reduced-transparency
media query
#30999
Conversation
Preview URLs (comment last updated: 2023-12-15 14:43:41) |
@chrisdavidmills, this PR is similar to #30712. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested 1) edits to see also and 2) moving the mention from the description section to the a11y section.
I am not sure if you want to expand on this PR or if we should open an issue, but this page could use some work completely unrelated to the PRT issue.
Stuff i would love to see
- Even though the element is not visible, it is still part of the DOM. If it was in the tabindex order when visible it will still be there. We do mention pointer events. But we should tell people to make the content visible when focused.
- Opacity alone should not be used to provide information to screen readers. Use the
hidden
attribute orvisibility
ordisplay
style properties. It's best to avoid usingaria-hidden
attribute, but if hidden with opacity, hide it from screen readers too. - a mention of setting opacity as a value for @starting-style when transitioning from display none to a visible value.
- a comment in the stacking context paragraph about how adding opacity can improve perf, with a link to where that's described.
- maybe a link to a drag/drop example as opacity is commonly used on items being dragged.
Co-authored-by: Estelle Weyl <[email protected]>
@estelle I prefer no to expand this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🎉
…n#30999) * CSS `opacity` based on `prefers-reduced-transparency` media query * Apply suggestions from code review Co-authored-by: Estelle Weyl <[email protected]> * update --------- Co-authored-by: Estelle Weyl <[email protected]> S
…n#30999) * CSS `opacity` based on `prefers-reduced-transparency` media query * Apply suggestions from code review Co-authored-by: Estelle Weyl <[email protected]> * update --------- Co-authored-by: Estelle Weyl <[email protected]> S
…n#30999) * CSS `opacity` based on `prefers-reduced-transparency` media query * Apply suggestions from code review Co-authored-by: Estelle Weyl <[email protected]> * update --------- Co-authored-by: Estelle Weyl <[email protected]>
Description
Add an example that demonstrates how to use the
prefers-reduced-transparency
media query to specify the desiredopacity
based on the user's preferences.